///////////////////////////////////////
//    Autor: Mato Kormuth              //
//    (C) Mato Programs 2011        //
//////////////////////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MBMC_Installation
{
    public partial class Form1 : Form
    {
        string[] array;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            array = new string[5];
            //Load other components
            bool installation_audacity = System.IO.File.Exists(Application.StartupPath + "/data/audacity_plugin.exe");
            bool installation_oldversion = System.IO.File.Exists(Application.StartupPath + "/data/Setup.exe");
            bool installation_setup = System.IO.File.Exists(Application.StartupPath + "/data/mbmc.data"); //if not exist check ci je instalovana predchadzajuca verzia
            bool installation_audacity2 = System.IO.File.Exists(Application.StartupPath + "/data/audacity_plugin2.exe");

            //Podmienky
            if (installation_audacity == true)
            {
                string acname = "Audacity Plugin/Standalone with all plugins";
                listBox1.Items.Add(acname);
                listBox2.Items.Add(new StringBuilder("audacity").ToString());
                //array[0] = "audacity";
            }
            if (installation_oldversion == true)
            {
                //Kompletna instalacia - najprv oldversion a potom
                string oldname = "Marble Blast Mods Creator 0.2.1 (BASE INSTALLATION)";
                listBox1.Items.Add(oldname);
                listBox2.Items.Add(new StringBuilder("oldversion").ToString());
                array[1] = "oldversion";
            }
            if (installation_setup == false)
            {
                //Patch neexistuje
                MessageBox.Show("Patch installation file doesn't exist! Maybe is installation broken. Or you rename file installation directory/data/mbmc.data.", "MBMC Installation", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listBox2.Items.Add(new StringBuilder("mbmc").ToString());
            listBox2.Items.Add(new StringBuilder("updater").ToString());
            listBox2.Items.Add(new StringBuilder("gimp").ToString());
            array[2] = "mbmc";
            array[3] = "updater";
            array[4] = "gimp";
            Paths p = new Paths(array, listBox2.Items);
        }
    }
}